<!DOCTYPE html>
<html>
  <head>
      <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
        <input type="text" ref="input_text" placeholder="请输入用户名"/>
        <select ref="select_x">
            <option value="1">星期一</option>
            <option value="2">星期二</option>
            <option value="3">星期三</option>
        </select>
        <input type="button" value="click" @click="getRefs"/>
    </div>
    <script>

    const vm = new Vue({
      el: '#app',
        data(){
          return{

          }
        },
        methods:{
            getRefs(){
                const ref=this.$refs
                console.log("refs",this.$refs)
                alert(ref.input_text.value)
                alert(ref.select_x.value)
            }
        }
    })
    </script>
  </body>
</html>